<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>类型重量</title>
	<link rel="stylesheet" href="<?php echo IMG_PATH ?>bdkd/css/reset.css">
	<link rel="stylesheet" href="<?php echo IMG_PATH ?>bdkd/css/zl_scss.css?saasd=2">
	<script src="<?php echo IMG_PATH ?>bdkd/js/jquery-1.11.1.min.js"></script>
	<script src="<?php echo IMG_PATH ?>bdkd/js/flexible.js"></script>
</head>
<body>
<!--<p><a style=" display:inline-block;width: 4rem; height: 2rem; border: 1px solid #006600;" href="javascript:window.location.reload()">刷新</a></p>
-->
	<nav>
		<p>物品类型</p>
	</nav>
	<div class="leixin">
		<ul class="leixin-one">
			<li class="li-one">
				<img class="tu-one" src="<?php echo IMG_PATH ?>bdkd/img/衣服@2x.png" height="64" width="64" alt="">
				<span>衣服</span>
			</li>
			<li class="li-two">
				<img class="tu-three" src="<?php echo IMG_PATH ?>bdkd/img/日用@2x.png" height="64" width="64" alt="">
				<span>日用</span>
			</li>
			<li class="li-three">
				<img class="tu-five" src="<?php echo IMG_PATH ?>bdkd/img/吃@2x.png" height="64" width="64" alt="">
				<span>食品</span>
			</li>
		</ul>
		<ul>
			<li class="li-four">
				<img class="tu-seven" src="<?php echo IMG_PATH ?>bdkd/img/电子@2x.png" height="64" width="64" alt="">
				<span>电子</span>
			</li>
			<li class="li-five">
				<img class="tu-nine" src="<?php echo IMG_PATH ?>bdkd/img/文件@2x.png" height="64" width="64" alt="">
				<span>文件</span>
			</li>
			<li class="li-six">
				<img class="tu-eleven" src="<?php echo IMG_PATH ?>bdkd/img/其他@2x.png" height="64" width="64" alt="">
				<span>其他</span>
			</li>
		</ul>
	</div>
	<div class="wpzl">
		<div class="wupinzhongliang">
			<span>物品重量</span>
			<span><img class="xieyi" src="<?php echo IMG_PATH ?>bdkd/img/协议@2x.png" height="22" width="22" alt="">未知</span>
		</div>
	</div>
	<div class="zhongliang">
		<img class="jian" src="<?php echo IMG_PATH ?>bdkd/img/减1@2x.png" height="48" width="48" alt="">
		<span><a>0.0</a>KG</span>
		<img class="jia" src="<?php echo IMG_PATH ?>bdkd/img/加1@2x.png" height="48" width="48" alt="">
	</div>
	<div class="kdgs">
		<div class="kuaidigongsi">
			<span>快递公司</span>
		</div>
	</div>
	<form action="">
		<div class="gongsi">
			<div class="tongyonger">
				<h1>快速</h1>
				<span><img class="kuaisu" src="<?php echo IMG_PATH ?>bdkd/img/协议1@2x.png" height="22" width="22" alt="">顺丰速运</span>
			</div>
			<div class="tongyonger">
				<h1>普通</h1>
				<span><img class="putong" src="<?php echo IMG_PATH ?>bdkd/img/协议1@2x.png" height="22" width="22" alt="">三通一达</span>
			</div>
			<div class="tongyonger">
				<h1>便宜</h1>
				<span><img class="pianyi" src="<?php echo IMG_PATH ?>bdkd/img/协议1@2x.png" height="22" width="22" alt="">优速快递</span>
			</div>
		</div>
	</form>
	
	<div class="yfgs">
		<div class="yunfeigusuan">
			<span>运费估算</span>
		</div>
	</div>
	<div class="gusuan">
		<p>--.-元</p>
		<p>首重10元，续重10元/公斤</p>
	</div>
	<div class="fuwuxieyi">
		<div class="anniu">
			<span>
				<img class="zl_xieyi" src="<?php echo IMG_PATH ?>bdkd/img/协议1@2x.png" alt="">
			</span>
			
			<span>实际运费以上门确认为主，部分快递以体积计算</span>
			
		</div>
<!--		<div class="btn" onclick="window.open('../jikkuaidi/ji.html')">确认</div>-->
        <div class="btn" onclick="ji()">确认</div>
	</div>
<input class="xieyi-bug-rjx" type="hidden" value=""/>
<script type="text/javascript">

    var custom_num=0;

    $('.xieyi').click(function(){
        custom_huantu(this);
        custom_num=custom_num===0?1:0;
//        console.log(custom_num);
        $('.xieyi-bug-rjx').val(custom_num);
        console.log($('.xieyi-bug-rjx').val());

        if(custom_num===1){
            $('.zhongliang span').css('color','#14a5fb');
            $('.zhongliang span a').html("1.0");
        }else if(custom_num===0){
            $('.zhongliang span').css('color','#d4d4d4');
            $(".jian").attr("src","<?php echo IMG_PATH ?>bdkd/img/减1@2x.png");
            $(".jia").attr("src","<?php echo IMG_PATH ?>bdkd/img/加1@2x.png");
            $('.zhongliang span a').html("0.0");
        }

    });

    /*加减号切换*/
    $('.jian').click(function(){
        custom_num=1;
        $('.zhongliang span').css('color','#14a5fb');
        $(".xieyi").attr("src","<?php echo IMG_PATH ?>bdkd/img/协议1@2x.png");
        $(this).attr("src","<?php echo IMG_PATH ?>bdkd/img/减@2x.png");
        $(".jia").attr("src","<?php echo IMG_PATH ?>bdkd/img/加1@2x.png");
        var num1 = Number($('.zhongliang span a').html()).toFixed(1);
        console.log(num1);
        var num2=(num1-1).toFixed(1);
        if(num2<=0){
            num2=0.0;
        }
        $('.zhongliang span a').html(num2);
        $('.xieyi-bug-rjx').val(custom_num);
        console.log($('.xieyi-bug-rjx').val());
        if($('.xieyi-bug-rjx').val()===1){

        }
    });

    $('.jia').click(function(){
        custom_num=1;
        $('.zhongliang span').css('color','#14a5fb');
        $(".xieyi").attr("src","<?php echo IMG_PATH ?>bdkd/img/协议1@2x.png");
        $(this).attr("src","<?php echo IMG_PATH ?>bdkd/img/加@2x.png");
        $(".jian").attr("src","<?php echo IMG_PATH ?>bdkd/img/减1@2x.png");
        var num1 = parseFloat($('.zhongliang span a').html());
        var num2=(num1+1).toFixed(1);
        $('.zhongliang span a').html(num2);
        $('.xieyi-bug-rjx').val(custom_num);
        console.log($('.xieyi-bug-rjx').val());
    });
    /*加减号切换*/
    /*死函数*/
    function custom_huantu(ele){
        var tupian1 = $(ele).attr("src");
        var newSrc = tupian1 === '<?php echo IMG_PATH ?>bdkd/img/协议1@2x.png'?'<?php echo IMG_PATH ?>bdkd/img/协议@2x.png':'<?php echo IMG_PATH ?>bdkd/./zl_img/协议1@2x.png';
        $(ele).attr("src",newSrc);
    }

    function custom_huantu2(ele){
        var tupian1 = $(ele).attr("src");
        $(".gongsi .tongyonger span img").each(function(index,item){
            $(item).attr("src","<?php echo IMG_PATH ?>bdkd/img/协议1@2x.png");
        });
        var newSrc = tupian1 === '<?php echo IMG_PATH ?>bdkd/img/协议1@2x.png'?'<?php echo IMG_PATH ?>bdkd/img/协议@2x.png':'<?php echo IMG_PATH ?>bdkd/img/协议1@2x.png';
        $(ele).attr("src",newSrc);
    }
    /*死函数*/
    /*运费估算*/
    $(".gongsi .tongyonger span img").each(function(index,item){

        $(item).click(function(){
            custom_huantu2(this);
            console.log(typeof index);
            var gsmz = index + 1;
            var quzheng = parseInt($('.zhongliang span a').html());
            var weight = $('.zhongliang span a').html();
            var quyu = quzheng-1;
            if(index===0){
                $('.gusuan p:last').html('首重'+12+'元，续重'+1+'元/公斤');
                var kjiaqian = 12 + (quyu * 1);
            }else if(index===1){
                $('.gusuan p:last').html('首重'+8+'元，续重'+2+'元/公斤');
                var kjiaqian = 8 +(quyu * 2);
            }else if(index===2){
                $('.gusuan p:last').html('首重'+7+'元，续重'+2+'元/公斤');
                var kjiaqian = 7 + (quyu * 2);
            }
            if(index===0 || index===1 || index===2){


                $('.gusuan p:first').html(kjiaqian+'元').css('color','#14a4fb');
                localStorage.setItem('money',kjiaqian);
                localStorage.setItem('weight',weight);
                localStorage.setItem('gsmz',gsmz);

            }
        });
    });
    /*运费估算*/

    /*图片切换*/
    $('.leixin ul li img').each(function(index,item){
        $(item).click(function(){

            var fn_this=item;
            // console.log(fn_this);
            $('.leixin ul li img').each(function(index,item){
                switch($(item).attr("src")){
                    case "<?php echo IMG_PATH ?>bdkd/img/衣1@2x.png"://lanse
                        $(this).siblings().css('color','#666');
                        $(item).attr("src","<?php echo IMG_PATH ?>bdkd/img/衣服@2x.png");//hui
                        break;
                    case "<?php echo IMG_PATH ?>bdkd/img/组-3@2x.png":
                        $(this).siblings().css('color','#666');
                        $(item).attr("src","<?php echo IMG_PATH ?>bdkd/img/日用@2x.png");
                        break;
                    case "<?php echo IMG_PATH ?>bdkd/img/吃1@2x.png":
                        $(this).siblings().css('color','#666');
                        $(item).attr("src","<?php echo IMG_PATH ?>bdkd/img/吃@2x.png");
                        break;
                    case "<?php echo IMG_PATH ?>bdkd/img/电子1@2x.png":
                        $(this).siblings().css('color','#666');
                        $(item).attr("src","<?php echo IMG_PATH ?>bdkd/img/电子@2x.png");
                        break;
                    case "<?php echo IMG_PATH ?>bdkd/img/组-4@2x.png":
                        $(this).siblings().css('color','#666');
                        $(item).attr("src","<?php echo IMG_PATH ?>bdkd/img/文件@2x.png");
                        break;
                    case "<?php echo IMG_PATH ?>bdkd/img/其他1@2x.png":
                        $(this).siblings().css('color','#666');
                        $(item).attr("src","<?php echo IMG_PATH ?>bdkd/img/其他@2x.png");
                        break;
                }
                console.log("ok");
            });
            switch($(fn_this).attr("src")){

                case "<?php echo IMG_PATH ?>bdkd/img/衣服@2x.png"://hui
                    $(fn_this).attr("src","<?php echo IMG_PATH ?>bdkd/img/衣1@2x.png");//lan
                    $(this).siblings().css('color','#14a4fb');

                    break;
                case "<?php echo IMG_PATH ?>bdkd/img/日用@2x.png":
                    $(fn_this).attr("src","<?php echo IMG_PATH ?>bdkd/img/组-3@2x.png");
                    $(this).siblings().css('color','#14a4fb');
                    break;
                case "<?php echo IMG_PATH ?>bdkd/img/吃@2x.png":
                    $(fn_this).attr("src","<?php echo IMG_PATH ?>bdkd/img/吃1@2x.png");
                    $(this).siblings().css('color','#14a4fb');
                    break;
                case "<?php echo IMG_PATH ?>bdkd/img/电子@2x.png":
                    $(fn_this).attr("src","<?php echo IMG_PATH ?>bdkd/img/电子1@2x.png");
                    $(this).siblings().css('color','#14a4fb');
                    break;
                case "<?php echo IMG_PATH ?>bdkd/img/文件@2x.png":
                    $(fn_this).attr("src","<?php echo IMG_PATH ?>bdkd/img/组-4@2x.png");
                    $(this).siblings().css('color','#14a4fb');
                    break;
                case "<?php echo IMG_PATH ?>bdkd/img/其他@2x.png":
                    $(fn_this).attr("src","<?php echo IMG_PATH ?>bdkd/img/其他1@2x.png");
                    $(this).siblings().css('color','#14a4fb');
                    break;
            }
            if(index===0){
                wplx ='衣服';
            }else if(index===1){
                wplx ='日用';
            }else if(index===2){
                wplx='食品';
            }else if(index===3){
                wplx='电子';
            }else if(index===4){
                wplx='文件';
            }else if(index===5){
                wplx='其他';
            }

            console.log(wplx);
            localStorage.setItem('goods',wplx);
        });
    });



    /*图片切换*/
    /*脚步协议切换*/
    $('.zl_xieyi').click(function(){
        custom_huantu(this);
        custom_num=custom_num===0?1:0;
    })
    /*脚步协议切换*/


    /*
    调到前一个页面
     */
    function ji() {
        //alert('<?php echo SITE_PATH ?>work/bexpress/ji?num=<?php echo $num;?>');return false;
        window.location.href = '<?php echo SITE_PATH ?>work/bexpress/ji?num=<?php echo $num;?>';
    }
</script>
</body>
</html>